<<<<<<< HEAD
// pages/film/detail.js
const app=getApp();
=======

const order = ['demo1', 'demo2', 'demo3']
>>>>>>> origin/master
Page({

  
  


  onShareAppMessage() {
    return {
      title: 'scroll-view',
      path: 'page/component/pages/scroll-view/scroll-view'
    }
  },

  data: {
    toView: 'green'
  },

  upper(e) {
    console.log(e)
  },

  lower(e) {
    console.log(e)
  },

  scroll(e) {
    console.log(e)
  },

  scrollToTop() {
    this.setAction({
      scrollTop: 0
    })
  },

  tap() {
    for (let i = 0; i < order.length; ++i) {
      if (order[i] === this.data.toView) {
        this.setData({
          toView: order[i + 1],
          scrollTop: (i + 1) * 200
        })
        break
      }
    }
  },

  tapMove() {
    this.setData({
      scrollTop: this.data.scrollTop + 10
    })
  },















  
  /**
   * 页面的初始数据
   */
  data: {
<<<<<<< HEAD
film:{}
=======
  
>>>>>>> origin/master
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
<<<<<<< HEAD
this.getFilm(options.id);
  },
  getFilm(id){
    app.$get('/film/detail',{id}).then(res=>{
      let data=res.data;
      this.setData({
        film:{
          ...data,
          premiereAt:this.fTime(data.premiereAt)
        }
      })
    })
  },
  fTime(time){
    let date=new Date(time);
    return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`;
=======
    wx.getLocation({
      type: 'wgs84',
      success(res) {
        console.log(res);
        const latitude = res.latitude;
        const longitude = res.longitude;
        wx.request({
          url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=XBZBZ-OBG63-LOD3N-3QR5Q-X6Z2Q-BFBIR`,
          success(res) {
            console.log(res);
          }
        })
      },
      fail(err) {
        console.log(err);
      }
    })

    
>>>>>>> origin/master
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },


  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})